<?php
/**
 * bs多规格sku商城系统
 * ============================================================================
 * 版权所有 2024-2099 wltx666.com，并保留所有权利。
 * 网站地址: https://wltx666.com
 * ============================================================================
 * Author: 草上飞
 * Email: wltx@alipay168.cn
 * QQ: 2719875001
 * Date: 2024/12/28
 * 描述:
 */

namespace app\admin\controller;

use app\result\SettingResult;
use think\App;

class Setting extends BaseAdmin
{
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->objResult = new SettingResult();
    }

    public function list()
    {
        data_exit_json($this->objResult->list($this->param));
    }

    /**
     * 获取配置信息
     * @return void
     */
    public function get()
    {
        data_exit_json($this->objResult->info($this->param));
    }


    /**
     * 更新配置项
     * @return void
     */
    public function save_data()
    {
        data_exit_json($this->objResult->action($this->param));
    }

    public function delete()
    {
        data_exit_json($this->objResult->delete($this->param['id']));
    }


    public function admin_info()
    {
        data_exit_json($this->objResult->admin_info($this->admin_id));
    }

    public function change_password()
    {
        data_exit_json($this->objResult->change_password($this->admin_id, $this->param['password'] ?? '', $this->param['password1'] ?? ''));
    }
}
